package com.example.juccode.juc01threadpool.demo04.Task;

import java.util.concurrent.Callable;

/**
 * @description: TODO
 * @date 2025/11/4 17:18
 */
public class CompletionTask implements Callable<Integer> {

    /**
     * 执行时间
     */
    private int timeout;

    public CompletionTask(int timeout) {
        this.timeout = timeout;
    }

    @Override
    public Integer call() throws Exception {
        //输出执行顺序
        System.out.println("执行顺序" + timeout);
        //使当前线程休眠指定时间
        Thread.sleep(timeout * 100L);
        //返回执行时间
        return timeout;
    }
}
